home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------------------
- -- Weapon Wings
- -- Original Carnage Contest Weapon
- -- Script by DC, November 2009, www.UnrealSoftware.de
- --------------------------------------------------------------------------------
-
- -- Setup Tables
- if cc==nil then cc={} end
- cc.wings={}
-
- -- Load & Prepare Ressources
- cc.wings.gfx_wpn=loadgfx("weapons/wings0.bmp") -- Weapon (Image Frame 1)
- setmidhandle(cc.wings.gfx_wpn)
- cc.wings.gfx_wpn2=loadgfx("weapons/wings1.bmp") -- Weapon (Image Frame 2)
- setmidhandle(cc.wings.gfx_wpn2)
- cc.wings.sfx_wings=loadsfx("flap.ogg") -- Sound
-
- --------------------------------------------------------------------------------
- -- Weapon: Wings
- --------------------------------------------------------------------------------
-
- cc.wings.id=addweapon("cc.wings","Wings",cc.wings.gfx_wpn,0) -- Add Weapon (0 uses)
-
- function cc.wings.draw() -- Draw
- if getframesleft()>1 and weapon_shots>0 then
- -- Setup draw mode
- setblend(blend_alpha)
- setalpha(1)
- setcolor(255,255,255)
- setscale(1,1)
- setrotation(0)
- -- Draw
- if weapon_timer>=10 then
- drawimage(cc.wings.gfx_wpn2,getplayerx(0)-1,getplayery(0))
- else
- drawimage(cc.wings.gfx_wpn,getplayerx(0)-1,getplayery(0))
- end
- end
- -- HUD Crosshair
- hudcrosshair(6,3)
- end
-
- function cc.wings.attack(attack) -- Attack
- if weapon_timer>0 then
- weapon_timer=weapon_timer-1
- end
- if (attack==1) and (weapon_timer<=0) then
- -- Use weapon and allow to use another one afterwards (1)
- useweapon(1)
- weapon_shots=weapon_shots+1
- weapon_timer=20
- -- FX
- playsound(cc.wings.sfx_wings)
- -- Push (absolute, don't push others)
- playerpush(0,math.sin(math.rad(getplayerrotation(0)))*3.0,-math.cos(math.rad(getplayerrotation(0)))*3.0-3.0,1,0)
- end
- if weapon_shots>0 then
- -- Avoid Falldamage / Limit Fall speed
- if getplayeryspeed(0)>4.0 then
- playerpush(0,getplayerxspeed(0),4.0,1,0)
- end
- end
- end